import { createStore, applyMiddleware, compose } from 'redux'
import thunk from 'redux-thunk'
import rootReducer from './reducers'
const composeEnhancers = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose
// 根据合并之后的 reducer 创建了 store 实例并导出
export default createStore(
  rootReducer,
  composeEnhancers(applyMiddleware(thunk))
)